﻿using System;
using System.Data;
using System.Configuration;
using System.Collections;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Web.UI.HtmlControls;
using SchoolsBI;

public partial class Admin_Alumnos_AlumnoCurso : System.Web.UI.Page
{
    protected void Page_Load(object sender, EventArgs e)
    {
        cboCurso.seleciona += new cboSelected(cboCurso_seleciona);

    }

    void cboCurso_seleciona(string param1, string param2)
    {

        ShowGridData();

    }


    private void ShowGridData()
    {
        GridView1.DataSource = ProfesorMaterias.Tabla("Proc_getAlumnosFromCurso " + cboCurso.Value);
        GridView1.DataBind();
        CboAlumnos.BindCBO();
    }






    protected void cmdOk_Click(object sender, EventArgs e)
    {
        AlumnosCurso aCurso = new AlumnosCurso();
        aCurso.IdAlumno = Convert.ToInt32(CboAlumnos.Value);
        aCurso.IdCurso = Convert.ToInt32(cboCurso.Value);
        aCurso.Anio = 2008;
        aCurso.Crear();
        ShowGridData();

    }
    protected void CboGeneric1_Load(object sender, EventArgs e)
    {

    }
    protected void cboCurso_Load(object sender, EventArgs e)
    {

    }

    protected void GridView1_RowDeleting(object sender, GridViewDeleteEventArgs e)
    {
        AlumnosCurso oAlCur = new AlumnosCurso();
        oAlCur.IdAlumnoCurso = Convert.ToInt32(GridView1.DataKeys[e.RowIndex].Value);
        oAlCur.Borrar();
        ShowGridData();
    }
}
